/*
 * c4_exercise6.cpp
 *
 *  Created on: Sep 1, 2013
 *      Author: cyper.yin
 */
#include <iostream>
using namespace std;

int main_c4e6(int argc, char **argv) {
	struct CandyBar {
		string brand;
		float weight;
		int calories;
	};

	CandyBar snacks[] = { { "sweetie", 12.3, 23 }, { "sweetie2", 13.3, 24 }, {"sweetie3", 14.3, 25 } };

	int length = sizeof(snacks) / sizeof(CandyBar);
	for (int i = 0; i < length; ++i) {
		CandyBar snack = snacks[i];
		cout << snack.brand << "," << snack.weight << "," << snack.calories
				<< endl;
	}

	return 0;

}

